<template>
  <div>
    <el-table :data="this.tableData" border stripe fit empty-text="暂无数据"  :cell-style="{'text-align':'center'}" height="100" max-height=500 lazy :header-cell-style="{'text-align':'center'}" >
      <el-table-column
        prop="jzdw" width="150"
        label="捐赠单位" fixed>
      </el-table-column>
      <el-table-column
        prop="rq"
        label="日期">
      </el-table-column>
      <el-table-column
        prop="lx"
        label="类型">
      </el-table-column>
      <el-table-column
        prop="rkwz"
        label="入库物资">
      </el-table-column>
      <el-table-column
        prop="slz"
        label="数量值">
      </el-table-column>
      <el-table-column
        prop="jldw"
        label="计量单位">
      </el-table-column>
      <el-table-column
        prop="je"
        label="金额">
      </el-table-column>
      <el-table-column
        prop="jydh"
        label="交易单号">
      </el-table-column>
    </el-table>
   <el-pagination
      @current-change="handleCurrentChange"
      :total="this.total"
      :page-size="10"
      background
      layout="total, prev, pager, next">
    </el-pagination>

  </div>
</template>

<script>

  export default {
    name: "Income",

    data() {
      return {
        total: 0,
        currentPage: 1,
        tableData:[],
      }
    },
    props:
      {
        detail_name: {type: String},
      },
    methods:
      {
        getData()
        {
          var url = '/detail/donation_info/';
          var params = {name: '武汉红十字基金会', limit: '20', offset: this.currentPage};
          this.$axios.get(url, {params})
            .then(res => {
              this.total = res.data.pages;
              this.tableData = res.data.data
            })
            .catch(function (error) {
              throw error;
            });
        },
        handleCurrentChange(val) {
          this.currentPage = val;
          this.getData()
        },},
        mounted(){
          this.getData();
        }

  }
</script>

<style scoped>

</style>
